<template>
  <div class="father">
    <h3>父组件</h3>
    <div class="content">
      <Category title="热门游戏列表">
        <ul>
          <li v-for="game of games" :key="game.id">{{ game.name }}</li>
        </ul>
      </Category>

      <Category title="今日美食城市">
        <img :src="imgURL" alt="" />
      </Category>

      <Category title="今日影视推荐">
        <video :src="videoURL" controls></video>
      </Category>
    </div>
  </div>
</template>

<script setup lang="ts" name="Father">
import { reactive, ref } from "vue";
import Category from "./Category.vue";

let games = reactive([
  { id: "asv1", name: "王者荣耀" },
  { id: "asv2", name: "英雄联盟" },
  { id: "asv3", name: "QQ飞车" },
  { id: "asv4", name: "地下城与勇士" },
]);
let imgURL = ref("https://z1.ax1x.com/2023/11/19/piNxLo4.jpg");
let videoURL = ref("http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4");
</script>

<style scoped>
.father {
  background-color: rgb(165, 164, 164);
  padding: 20px;
  border-radius: 10px;
}
.content {
  display: flex;
  justify-content: space-evenly;
}
img,
video {
  width: 100%;
}
</style>
